<extend name="public@base"/>
block(name='main')
    .wrap
        ul.nav.nav-tabs(role="tablist")
            li.nav-item: a.nav-link.active(href="{:url('mailer/index')}") {:lang('ADMIN_MAILER_INDEX')}
            li.nav-item: a.nav-link(href="{:url('mailer/template')}?template_key=verification_code") 数字验证码邮件模板
    form.form-horizontal.js-ajax-form(method='post', action!="{:url('Admin/mailer/indexPost')}")
        .form-group.form-row
            label.col-2.col-form-label.text-right(for='input-from_name')
                span.form-required
                | {:lang('SENDER_NAME')}
                a(href='http://www.thinkcmf.com/faq.html?url=https://www.kancloud.cn/thinkcmf/faq/493502', title='查看帮助手册', data-toggle='tooltip', target='_blank')
                    i.fa.fa-question-circle
            .col-10.col-lg-6
                input#input-from_name.form-control(type='text', name='from_name', value="{$from_name|default=''}")
        .form-group.form-row
            label.col-2.col-form-label.text-right(for='input-from')
                span.form-required
                | {:lang('SENDER_EMAIL_ADDRESS')}
            .col-10.col-lg-6
                input#input-from.form-control(type='text', name='from', value="{$from|default=''}")
        .form-group.form-row
            label.col-2.col-form-label.text-right(for='input-host')
                span.form-required
                | {:lang('SENDER_SMTP_SERVER')}
            .col-10.col-lg-6
                input#input-host.form-control(type='text', name='host', value="{$host|default=''}")
        .form-group.form-row
            label.col-2.col-form-label.text-right(for='js-smtpsecure')
                span.form-required
                | 连接方式
            .col-10.col-lg-6
                select#js-smtpsecure.form-control(name='smtp_secure')
                    option(value='') 默认
                    option(value='ssl') ssl
                    option(value='tls') tls
        .form-group.form-row
            label.col-2.col-form-label.text-right(for='input-port')
                span.form-required
                | SMTP服务器端口
            .col-10.col-lg-6
                input#input-port.form-control(type='text', name='port', value="{$port|default=''}", placeholder='默认为25')
        .form-group.form-row
            label.col-2.col-form-label.text-right(for='input-login_name')
                span.form-required
                | {:lang('SMTP_MAIL_ADDRESS')}
            .col-10.col-lg-6
                input#input-login_name.form-control(type='text', name='username', value="{$username|default=''}")
        .form-group.form-row
            label.col-2.col-form-label.text-right(for='input-password')
                span.form-required
                | {:lang('SMTP_MAIL_PASSWORD')}
            .col-10.col-lg-6
                input#input-password.form-control(type='password', name='password', value="{$password|default=''}")
        .form-group.form-row
            .col-auto.offset-2.btn-group
                button.btn.btn-sm.btn-primary.js-ajax-submit(type='submit') {:lang('SAVE')}
                a.btn.btn-sm.btn-warning(href="javascript:parent.openIframeDialog('{:url('mailer/test')}','发送测试邮件',{width:'600px',height:'400px'});") 测试邮件
block(name='bottom-script')
    script.
        $(function () {
            $('#js-smtpsecure').val("{$smtp_secure|default=''}");
        });
